<script lang="ts" setup>
import TimeVue from './Time.vue';
import Admin from './Admin.vue';
import { ref, onBeforeMount } from 'vue'
import { View, Refresh } from '@element-plus/icons-vue'
import aApi from '@/api/Thirdparty'
const dogtext = ref()
onBeforeMount(() => {
    dogf()
})
function dogf() {
    aApi.dog({}).then((res:any)=>{
        console.log(res);
        
    dogtext.value = res.data.data.text
    
}).catch(err=>{
    dogtext.value = '请求失败，暂无法加载！'
    
})

}
</script>
<template>
    <div>

        <el-card class="box-card">
            <Admin />
        </el-card>
        <el-card class="box-card">
            <TimeVue />
        </el-card>
        <el-card class="box-card">
            <template #header>
                <div class="card-header">
                    <span>舔狗日记</span>
                    <el-button class="button" style="float: right; padding: 3px 5px" type="primary" :icon="Refresh"
                        @click="dogf()" />
                </div>
            </template>
            <div class="text item">
                {{ dogtext }}
            </div>
        </el-card>
    </div>
</template>
<style lang="scss" scoped>
.box-card {
    margin: 10px auto;
}
</style>